/**
 * @param {number[]} nums
 * @return {number[]}
 */
 var bubbleSort = function (nums) {
    let len = nums.length - 1
    for (let i = 0; i < len; ++i) {
      for (let j = 0; j < len - i; ++j) {
        if (nums[j] > nums[j + 1]) {
          let temp = nums[j + 1]
          nums[j + 1] = nums[j]
          nums[j] = temp
        }
      }
    }
    return nums
  };